package edu.gatech.bsbmule.view;

import javax.swing.JFrame;
import javax.swing.JPanel;

/**
 * @author bsb
 *a class which represents the townwindow
 */
public class TownWindow extends JFrame {
		
	private static TownWindow instance = null;
	
	/**
	 * 
	 * @return object of type TownWindow
	 */
	public static TownWindow getInstance() {
		if (instance == null) {
			instance = new TownWindow();
		}
		return instance;
	}
	
	/**
	 * Create the window.
	 */
	private TownWindow() {
		
		setTitle("The Town");
		setBounds(100, 100, 448, 366);
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setPanel(TownScreen.getInstance());
	}
	
	/**
	 * sets the panel
	 * @param panel
	 */
	public void setPanel(JPanel panel) {
		setContentPane(panel);
		revalidate();		
	}
		
}
